package com.spa.infrastructure.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.spa.application.command.admin.AdminRoleEditCommand;
import com.spa.application.dto.PageResult;
import com.spa.application.dto.admin.SysRoleDto;
import com.spa.application.query.admin.AdminRoleQuery;
import com.spa.domain.entity.SysRole;
import com.spa.infrastructure.repository.condition.SysRoleCondition;
import com.spa.infrastructure.repository.po.SysRolePO;
import org.mapstruct.Mapper;
import org.mapstruct.MapperConfig;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
@MapperConfig(unmappedTargetPolicy = ReportingPolicy.WARN)
public interface SysRoleMapperStruct {

    SysRoleMapperStruct INSTANCE = Mappers.getMapper(SysRoleMapperStruct.class);

    Page<SysRole> po2Entity4Page(Page<SysRolePO> po);

    PageResult<SysRoleDto> entity2Dto4Page(Page<SysRole> entity);

    SysRoleCondition query2Condition(AdminRoleQuery query);

    SysRole po2Entity(SysRolePO po);

    SysRoleDto entity2Dto(SysRole entity);

    SysRolePO command2Po(AdminRoleEditCommand command);

    List<SysRoleDto> entity2DtoList(List<SysRole> entity);

    List<SysRole> po2Entity4List(List<SysRolePO> po);

}
